home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / The GIMP 2.2.8 / gimp-2.2.8-i586-setup.exe / {app} / share / gimp / 2.0 / scripts / beveled-pattern-hrule.scm < prev    next >
Encoding:
Text File  |  2005-06-30  |  2.8 KB  |  85 lines

  1. ; The GIMP -- an image manipulation program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ;
  4. ; Beveled pattern hrule for web pages
  5. ; Copyright (C) 1997 Federico Mena Quintero
  6. ; federico@nuclecu.unam.mx
  7. ;
  8. ; This program is free software; you can redistribute it and/or modify
  9. ; it under the terms of the GNU General Public License as published by
  10. ; the Free Software Foundation; either version 2 of the License, or
  11. ; (at your option) any later version.
  12. ;
  13. ; This program is distributed in the hope that it will be useful,
  14. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. ; GNU General Public License for more details.
  17. ;
  18. ; You should have received a copy of the GNU General Public License
  19. ; along with this program; if not, write to the Free Software
  20. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  
  22.  
  23. (define (script-fu-beveled-pattern-hrule width height pattern)
  24.   (let* ((img (car (gimp-image-new width height RGB)))
  25.      (background (car (gimp-layer-new img
  26.                       width height RGB-IMAGE
  27.                       "Hrule" 100 NORMAL-MODE)))
  28.      (bumpmap (car (gimp-layer-new img
  29.                        width height RGBA-IMAGE
  30.                        "Bumpmap" 100 NORMAL-MODE))))
  31.  
  32.     (gimp-context-push)
  33.  
  34.     (gimp-image-undo-disable img)
  35.     (gimp-image-add-layer img background -1)
  36.     (gimp-image-add-layer img bumpmap -1)
  37.  
  38.     ; Create pattern layer
  39.  
  40.     (gimp-context-set-background '(0 0 0))
  41.     (gimp-edit-fill background BACKGROUND-FILL)
  42.     (gimp-context-set-pattern pattern)
  43.     (gimp-edit-bucket-fill background PATTERN-BUCKET-FILL NORMAL-MODE 100 0 FALSE 0 0)
  44.  
  45.     ; Create bumpmap layer
  46.  
  47.     (gimp-edit-fill bumpmap BACKGROUND-FILL)
  48.  
  49.     (gimp-context-set-background '(127 127 127))
  50.     (gimp-rect-select img 1 1 (- width 2) (- height 2) CHANNEL-OP-REPLACE FALSE 0)
  51.     (gimp-edit-fill bumpmap BACKGROUND-FILL)
  52.  
  53.     (gimp-context-set-background '(255 255 255))
  54.     (gimp-rect-select img 2 2 (- width 4) (- height 4) CHANNEL-OP-REPLACE FALSE 0)
  55.     (gimp-edit-fill bumpmap BACKGROUND-FILL)
  56.  
  57.     (gimp-selection-none img)
  58.  
  59.     ; Bumpmap
  60.  
  61.     (plug-in-bump-map 1 img background bumpmap 135 45 2 0 0 0 0 TRUE FALSE 0)
  62.  
  63.     (gimp-image-set-active-layer img background)
  64.     (gimp-image-remove-layer img bumpmap)
  65.  
  66.     (gimp-image-undo-enable img)
  67.     (gimp-display-new img)
  68.  
  69.     (gimp-context-pop)))
  70.  
  71.  
  72. (script-fu-register "script-fu-beveled-pattern-hrule"
  73.             _"_Hrule..."
  74.             "Beveled pattern hrule"
  75.             "Federico Mena Quintero"
  76.             "Federico Mena Quintero"
  77.             "July 1997"
  78.             ""
  79.                     SF-ADJUSTMENT _"Width"   '(480 5 1500 1 10 0 1)
  80.                     SF-ADJUSTMENT _"Height"  '(16 1 100 1 10 0 1)
  81.             SF-PATTERN    _"Pattern" "Wood")
  82.  
  83. (script-fu-menu-register "script-fu-beveled-pattern-hrule"
  84.              _"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Beveled Pattern")
  85.